package com.atguigu.test2;

/**
 * @author 路飞
 * @date 2024/3/28 10:28
 * @description 1、用循环控制语句打印输出：1+3+5+...+99=?的结果
 */
public class Exer1 {
    public static void main(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 100; i+=2) {
            sum += i;
        }
        System.out.println("sum = " + sum);
    }
}
